package com.daervin.svc.common.config;

import com.daervin.svc.common.handler.SessionHandler;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by daervin on 2023/8/26
 */
@Configuration
public class ListenerConfig {

    @Bean
    public ServletListenerRegistrationBean<SessionHandler> sessionListener() {
        ServletListenerRegistrationBean<SessionHandler> listenerRegistrationBean =
                new ServletListenerRegistrationBean<>();
        listenerRegistrationBean.setListener(new SessionHandler());
        return listenerRegistrationBean;
    }
}
